import dao.CheckItemDao;
import dao.impl.CheckItemDaoImpl;
import entity.CheckItem;
import utils.ConnectionUtil;

import java.sql.Connection;
import java.sql.SQLException;

/**
 * @projectName: Hospital
 * @package: PACKAGE_NAME
 * @className: Test3
 * @author: 翟
 * @date: 2025/3/31 11:54
 */

public class Test3 {
    /**
     * 医院增加了“CT”检查项目，检查费用定价120元
     */
    public static void main(String[] args) {
        CheckItem checkItem = new CheckItem("CT", 120);
        Connection conn = null;
        try {
            conn = ConnectionUtil.getConnection();
            CheckItemDao checkItemDao = new CheckItemDaoImpl(conn);
            if (checkItemDao.addCheckItemInfo(checkItem) == 1){
                System.out.println("添加成功");
            }else{
                System.out.println("添加失败");
            }
        } catch (SQLException e) {
            e.printStackTrace();
        }finally {
            ConnectionUtil.closeALL(null , null , conn);
        }
    }
}
